﻿[%^Main%]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/DinoRichCMS.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>VietSilver CMS</title>
<!-- InstanceEndEditable -->
<link href="~/../style/reset.css" rel="stylesheet" type="text/css" />
<link href="~/../style/960.css" rel="stylesheet" type="text/css" />
<link href="~/../style/global.css" rel="stylesheet" type="text/css" />
<link href="~/../style/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="~/../js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/jquery.validate.pack.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/global.js"></script>
<!-- InstanceBeginEditable name="head" -->
<link href="~/../style/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="~/../js/jquery.popupWindow.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/jquery.lightbox-0.5.pack.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/tinymce/jquery.tinymce.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/tinymce/init.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/file.js"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {

        //$('#spot_to').val('{{crgalleryID}}');

        $("#accordion").accordion("activate", 5);
        $('input[type=submit]').click(function () {
            $('#submitaction').val($(this).attr('name'));
        });
        InitTinyMCE();
        var container = $('#error');

        $('#editForm').validate({
            errorContainer: container,
            errorLabelContainer: $('ol', container),
            wrapper: 'li',
            rules: {
                galleryName: { required: true, minlength: 1, maxlength: 255 },
                galleryGroup: { required: true, maxlength: 255 },
                galleryImage: { required: true }
            },
            messages: {
                galleryName: {
                    required: '{{#galleryNameRequire}}',
                    minlength: '{{#galleryNameMinLength}}',
                    maxlength: '{{#galleryNameMaxLength}}'
                },
                galleryGroup: {
                    required: 'Chưa chọn nhóm'
                },
                galleryImage: {
                    required: 'Chưa chọn ảnh sản phẩm'
                }
            }
        });
        $("#galleryImageView").click(function (e) {
            $('#x').html(e.pageX - $(this).position().left);
            $('#y').html(e.pageY - $(this).position().top);
        });

        $('#galleryDate').datepicker();

        $('input[name=selectCategory]').click(function () {
            $('#galleryCategory').val($('input[name=selectCategory]').serialize());
        });

        SelectCategory();

        $('.selectImage').popupWindow({
            centerBrowser: 1,
            height: 530,
            width: 850,
            resizable: 1,
            windowName: '{{#SelectAFile}}'
        });

        $('a.galleryImage').lightBox({ fixedNavigation: true });

//        $('#galleryStyle').val('{{galleryStyle}}');
//        $('#galleryColor').val('{{galleryColor}}');
//        $('#galleryPattern').val('{{galleryPattern}}');
//        $('#galleryMaterial').val('{{galleryMaterial}}');


//        $('#type_gallery').val('{{crroomDetailsType}}');
//        $('#spot').css('display', 'none');
//        $('#area').css('display', 'none');
//        $('#tooltip').css('display', 'none');
//        $('#info').css('display', 'none');
//        $('#{{crroomDetailsType}}').css('display', 'block');

//        $('#type_gallery').change(function () {
//            var divid = $(this).attr('value');
//            $('#spot').css('display', 'none');
//            $('#area').css('display', 'none');
//            $('#tooltip').css('display', 'none');
//            $('#info').css('display', 'none');
//            $('#' + divid).css('display', 'block');
//        });
    });    

	function AddNew(){
	    if (!$('#editForm').valid()) return;
	    AjaxResult('roomgallery&action=addnew', $('#editForm').serialize(), '{{#AddNewOK}}', '{{#AddNewFail}}', false, function (data) { Redirect("roomgallery.aspx"); });
	}
	
	function AddAndContinue(){
	    if (!$('#editForm').valid()) return;	    
	    AjaxResult('roomgallery&action=addnew&mode=continue', $('#editForm').serialize(), '{{#AddNewOK}}', '{{#AddNewFail}}', false);
	}

	function AddNewDetails() {
	    if (!$('#editForm').valid()) return;
	    AjaxResult('roomgallery&action=addNewDetails&id={{galleryID}}', $('#editForm').serialize(), '{{#EditOK}}', '{{#EditFail}}', false, function (data) { window.reload(); });
	}

	function Edit(){
	    if (!$('#editForm').valid()) return;
	    AjaxResult('roomgallery&action=edit&id={{galleryID}}&did={{crroomDetailsID}}', $('#editForm').serialize(), '{{#EditOK}}', '{{#EditFail}}', false, function (data) { Redirect("roomgallery.aspx"); });
	}
	
	function EditAndContinue(){
	    if (!$('#editForm').valid()) return;
	    AjaxResult('roomgallery&action=edit&id={{galleryID}}&did={{crroomDetailsID}}', $('#editForm').serialize(), '{{#EditOK}}', '{{#EditFail}}', true);
	}
	function GenJsFile() {
	    AjaxResult('roomgallery&action=genjsfile', '{{#EditOK}}', '{{#EditFail}}', true);
	}
	function SelectCategory(){
		var categories = '{{selectedCategory}}'.split(',');
		
		for(i = 0; i < categories.length; i++){
			$('input[name=selectCategory][value=' + categories[i] + ']').attr('checked', 'checked');
		}
		
		$('#galleryCategory').val($('input[name=selectCategory]').serialize());
	}

</script>
<!-- InstanceEndEditable -->
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>
<body class="twoColFixLtHdr">
<div id="user">
	<div id="center_user">
	{{#Hi}} <strong>{{fullName}}</strong> | <a href="javascript:void(0);" onclick="javascript:LogOut();">{{#Logout}}</a>  
	<span id="company">{{#Company}}</span>
	</div>
</div>
<div id="logo">
	<div id="center_logo">
		<img id="vietsilver" src="~/../images/viet_silver.png" alt="viet silver" />
		<strong>{{#Language}}: </strong>[%^LanguageFlag%][%^LanguageFlagItem%]<a href="javascript:void(0);" class="language" onclick="javascript:ChangeLanguage('{{langCode}}');" title="{{langName}}"><img src="~/../images/{{langCode}}.png" alt="{{langName}}" /></a>[%$LanguageFlagItem%][%$LanguageFlag%]
	</div>
</div>
<div id="container">
  <div id="header">
  	<!--<a href="/">Home</a> Danh sách tin-->
	
  </div>
  <div id="sidebar1">
    <div id="accordion">
      <h3><a href="#"><img src="~/../images/news.png" /><em>{{#News}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../news.aspx">{{#NewsList}}</a></li>
          <li><a href="~/../news.aspx?type=add">{{#AddNew}}</a></li>
          <li><a href="~/../category.aspx?filter=news">{{#ListCategory}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/product.png" /><em>{{#Products}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../product.aspx">{{#ProductList}}</a></li>
          <li><a href="~/../product.aspx?type=add">{{#AddNew}}</a></li>
          <li><a href="~/../category.aspx?filter=product">{{#ListCategory}}</a></li>
          <!--<li><a href="~/../order.aspx">{{#Orders}}</a></li>-->
        </ul>
      </div>
      <!--<h3><a href="#">{{#Categories}}</a></h3>
      <div>
        <ul>
          <li><a href="category.aspx">{{#ListCategory}}</a></li>
          <li><a href="category.aspx?type=add">{{#AddNew}}</a></li>
        </ul>
      </div>-->
      <h3><a href="#"><img src="~/../images/user.png" /><em>{{#Admin}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../user.aspx">{{#UserList}}</a></li>
          <li><a href="~/../user.aspx?type=add">{{#AddNew}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/advertise.png" /><em>{{#Advertise}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../advertise.aspx">{{#AdvertiseList}}</a></li>
          <li><a href="~/../advertise.aspx?type=add">{{#AddNew}}</a></li>
          <li><a href="~/../layout.aspx?type=advertise-position">{{#ConfigPosition}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/position.png" /><em>{{#Position}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../position.aspx">{{#PositionList}}</a></li>
          <li><a href="~/../position.aspx?type=add">{{#AddNew}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/setting.png" /><em>{{#Other}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../layout.aspx?type=category-position&categoryType=news-category">{{#Layout}}</a></li>
          <li><a href="~/../setting.aspx">{{#Settings}}</a></li><li><a href="~/../roomgallery.aspx?type=edit&id=0">{{#Map}}</a></li><li><a href="~/../roomgallery.aspx?type=add">{{#NewMap}}</a></li>
        </ul>
      </div>
    </div>
  </div>
  <div id="mainContent">
  	<!-- InstanceBeginEditable name="Content" -->[%^Content%]
    <h3>&raquo; {{#Manage}} {{#galleryLC}}</h3>[%^EditForm%]
    <div id="error" class="editError">
			<p><strong>{{#Error}}:</strong></p>
		  <ol></ol>
		</div>
    <div id="errorAjax" class="result">
      <p><img src="~/../images/ok.png" /><span id="result-message"></span></p>
    </div>
    <div id="edit">
    	<form id="editForm" action="" method="post" onsubmit="return(Compare())">      	      	
        <p id="roomGallery" style="width: 256px; height: 502px; background: #a4a4a4; margin: 0; padding: 0;"><img id="galleryImageView" src="~/../images/vietnam.png" style="width: 256px; height: 502px;" />        
        </p>        
        <h4 style="color: red">X: <span id="x">0</span> Y: <span id="y">0</span></h4>
        
        <p id="settingContainer">
            <div id="spot">
                <p>        
                    <label>{{#To}}: </label><input type="text" id="spot_to" name="spot_to" class="tinyinput" value="{{rDetailsLink}}" /><br />
            [%^RoomDetails%]   
                    <input type="hidden" value="{{rDetailsID}}" />               
                    <label>{{#Coordinates}}: </label><input type="text" id="spot_x" name="spot_x" class="tinyinput" value="{{rx1}}" onKeyPress='if((event.keyCode< 48)|| (event.keyCode > 57)) event.returnValue =false' /> X
                    <input type="text" id="spot_y" name="spot_y" class="tinyinput" value="{{ry1}}" onKeyPress='if((event.keyCode< 48)|| (event.keyCode > 57)) event.returnValue =false' /> Y <br />
                    <p><label>{{#Info}}: </label><textarea type="text" id="spot_content" name="spot_content" class="mediuminput">{{rDetailsContent}}</textarea><br />
                    <!--<p><a class="button" href="javascript:void(0);" onclick="AddNewSpot();">{{#Add}}</a></p>-->
                </p>
            </div>            
            [%$RoomDetails%]
        </p>
        <p id="roomDetails">
            [%^Type%]
                <table class="mainTable">
                    <thead>
                        <tr>
                            <th width="4%"><a href="javascript:void(0);" onclick="ToggleSelect();">{{#Select}}</a></th>
                            <th width="15" align="center">{{#Link}}</th>
                            <th width="*" align="center">{{#Coordinates}}</th>
                            <th width="12%" align="center">{{#Content}}</th>            
                            <th width="21%" align="center">{{#Action}}</th>
                        </tr>
                    </thead>
                    <tbody>[%^TypeItem%]
                        <tr>                                                
                            <td><input type="checkbox" class="roomDetailsID" name="roomDetailsID" value="{{roomDetailsID}}" /></td>
                            <td align="center">{{roomDetailsLink}}</td>
                            <td align="center">{{roomCoordinates}}</td>
                            <td align="center">{{roomDetailsContent}}</td>
                            <td align="center"><a href="RoomGallery.aspx?type=edit&id={{galleryID}}&object={{roomDetailsType}}&did={{roomDetailsID}}">{{#Edit}}</a> | <a href="RoomGallery.aspx?type=delete&object=details&id={{roomDetailsID}}">{{#Delete}}</a></td>
                        </tr>[%$TypeItem%]
                    </tbody>
            </table>[%$Type%]
        </p>
        <p class="action">        	                
          <input type="hidden" id="roomgalleryid" value="{{roomDetailsID}}" />
          <input type="hidden" id="submitaction" />[%^AddNew%]
          <input type="button" id="addnew" name="addnew" value="{{#AddNew}}" onclick="AddNew();" />
          <input type="button" id="addandcontinue" name="addandcontinue" value="{{#Add}} {{#AndContinue}}" onclick="AddAndContinue();" />[%$AddNew%][%^Edit%]
          <p style="position: absolute; margin: right; float: right; top: 600px; left: 800px;">          
            <input type="button" id="btnAddNewDetails" name="save" value="{{#AddNew}}" onclick="AddNewDetails();" />
            <input type="button" value="{{#GenJsFile}}" onclick="GenJsFile();" />
          </p>
          <input type="button" id="save" name="save" value="{{#Save}}" onclick="Edit();" />
          <input type="button" id="saveandcontinue" name="saveandcontinue" value="{{#Save}} {{#AndContinue}}" onclick="EditAndContinue();" />
          
          [%$Edit%]
          <input type="button" id="goBack" name="goBack" onclick="javascript:history.go(-1);" value="{{#GoBack}}" />
		</p>
      </form>
    </div>[%$EditForm%][%^Error%]
    <div id="notFound" class="editError">{{#NotFound}}</div>
    <script>$('#notFound').show();</script>[%$Error%]
		[%$Content%]<!-- InstanceEndEditable -->
  </div>

  <br class="clearfloat" />
  <div id="footer" class="clearfix">
  	<p class="fleft">{{#CopyrightText}}</p>
  </div>
</div>
</body>
<!--{{errorCode}}-->
<!-- InstanceEnd --></html>
[%$Main%]



